#ifndef __SNAKE_H__
#define __SNAKE_H__

#define TOWARDS_LEFT 0
#define TOWARDS_UP 1
#define TOWARDS_RIGHT 2
#define TOWARDS_DOWN 3

typedef struct Coordinate{
    unsigned short x;
    unsigned short y;
} coord;

typedef struct SnakeNode{
    struct SnakeNode *p_next_node;
    coord location;
} node;

typedef struct GameStatus{
    mtx_t game_lock;
    atomic_int is_run;
    node *p_snake_head;
    coord canvas;
    coord food;
    unsigned int direction;
    float speed;
    unsigned int length;
    time_t time;
    float score;
} game;


int PutChar(int const Ch,coord const Pos);
int GameSteer(game *p_game);
int GameInit(game *p_game);
int GameRun(game *p_game);
int GameStop(game *p_game);
int SnakeMove(game *p_game);
int FreshGameInfo(game *p_game);
#endif  //__SNAKE_H__